package com.example.mttab

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class MainActivity : AppCompatActivity() {
    private val mMNav: MMBottomNavView? by lazy { findViewById(R.id.mmnav) };
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        initView()
    }

    private fun initView() {
        val bottomNavData = arrayListOf<MMBottomNavView.MMBottomNavDataBean>(
            MMBottomNavView.MMBottomNavDataBean(
                "首页",
                R.color.color_FB615C,
                R.color.black,
                R.drawable.wp_tab_home_select,
                R.drawable.wp_tab_home_default
            ),
            MMBottomNavView.MMBottomNavDataBean(
                "发现",
                R.color.color_FB615C,
                R.color.black,
                R.drawable.wp_tab_find_select,
                R.drawable.wp_tab_find_default
            ),
            MMBottomNavView.MMBottomNavDataBean(
                "消息",
                R.color.color_FB615C,
                R.color.black,
                R.drawable.wp_tab_msg_select,
                R.drawable.wp_tab_msg_default
            ),
            MMBottomNavView.MMBottomNavDataBean(
                "我的",
                R.color.color_FB615C,
                R.color.black,
                R.drawable.wp_tab_mine_select,
                R.drawable.wp_tab_mine_default
            )
        )
        mMNav?.setNavData(bottomNavData, 0)
        mMNav?.setMsgNum(3, 10)
    }
}